﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BomberManServer.Gaming.Object.Mapping.Model.States;
using BomberManServer.Utils;

namespace BomberManServer.Gaming.Object.Mapping.Model.Maps
{
    public class Duel : Map
    {
        //private Spawn spawn1, spawn2;
        public Duel(Game game) : base(game,13,9)
        {
            Zone zone = new Zone(Constants.instance.nbBonusDuel, game);
            builders.Add(zone);

            // bonusblock full lignes
            foreach (UInt32 x in Enumerable.Range(1, 11))
                foreach (UInt32 y in Enumerable.Range(1, 7))
                {
                    if (((x == 1) && (y < 3)) || ((y == 1) && (x < 3))) continue;
                    if (((x == 11) && (y > 5)) || ((y == 7) && (x > 9))) continue;
                    if ((x % 2 == 1) || (y % 2 == 1)) zone.attach(blocks.at(x, y));
                }

            // set spawns
            blocks.at(1, 1).state = new Spawn(game.match.players[0],1,1);
            blocks.at(11, 7).state = new Spawn(game.match.players[1],11,7);

            // set free
            blocks.at(2, 1).state = Constants.instance.stateFree;
            blocks.at(1, 2).state = Constants.instance.stateFree;

            blocks.at(10, 7).state = Constants.instance.stateFree;
            blocks.at(11, 6).state = Constants.instance.stateFree;

            zone.initialize();
        }
    }
}
